package com.yc.dygang.web;

import com.google.gson.Gson;
import com.yc.common.util.DBHelper;
import com.yc.dygang.dao.CategoryDao;
import com.yc.dygang.util.Utils;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet(name = "CategoryServlet", value = "/queryCate.s")
public class QueryCategoryServlet extends HttpServlet {

    private CategoryDao categoryDao = new CategoryDao();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        List<Map<String, Object>> list = categoryDao.selectAll();
        Utils.toJson(list, response);
    }
}
